From 3f23e585b298ef3f7f601a1369022c7ec39c96f1 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 4 Oct 2005 15:02:35 +0100 Subject: [PATCH] Rename VCPUOP_craete to VCPUOP_initialise. It is likely that VCPU creation will actually be moved to domain-build time. Signed-off-by: Keir Fraser --- .../arch/xen/i386/kernel/smpboot.c | 4 ++-- .../arch/xen/x86_64/kernel/smpboot.c | 2 +- xen/common/domain.c | 4 ++-- xen/include/public/vcpu.h | 17 ++++++++--------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c index c3e11cc0c2..2a9213decb 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c @@ -883,7 +883,7 @@ static int __init do_boot_cpu(int apicid) ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT; - boot_error = HYPERVISOR_vcpu_op(VCPUOP_create, cpu, &ctxt); + boot_error = HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, &ctxt); if (boot_error) printk("boot error: %ld\n", boot_error); @@ -1624,6 +1624,6 @@ void vcpu_prepare(int vcpu) ctxt.ctrlreg[3] = virt_to_mfn(swapper_pg_dir) << PAGE_SHIFT; - (void)HYPERVISOR_vcpu_op(VCPUOP_create, vcpu, &ctxt); + (void)HYPERVISOR_vcpu_op(VCPUOP_initialise, vcpu, &ctxt); (void)HYPERVISOR_vcpu_op(VCPUOP_up, vcpu, NULL); } diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c index 86a050bba1..1fb1ceab86 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c @@ -771,7 +771,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) ctxt.ctrlreg[3] = virt_to_mfn(init_level4_pgt) << PAGE_SHIFT; - boot_error = HYPERVISOR_vcpu_op(VCPUOP_create, cpu, &ctxt); + boot_error = HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, &ctxt); if (boot_error) printk("boot error: %ld\n", boot_error); diff --git a/xen/common/domain.c b/xen/common/domain.c index a4969811ee..890a61f205 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -412,12 +412,12 @@ long do_vcpu_op(int cmd, int vcpuid, void *arg) if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) ) return -EINVAL; - if ( ((v = d->vcpu[vcpuid]) == NULL) && (cmd != VCPUOP_create) ) + if ( ((v = d->vcpu[vcpuid]) == NULL) && (cmd != VCPUOP_initialise) ) return -ENOENT; switch ( cmd ) { - case VCPUOP_create: + case VCPUOP_initialise: if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL ) { rc = -ENOMEM; diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h index c034f3f59e..ff5e463a0d 100644 --- a/xen/include/public/vcpu.h +++ b/xen/include/public/vcpu.h @@ -1,7 +1,7 @@ /****************************************************************************** * vcpu.h * - * VCPU creation and hotplug. + * VCPU initialisation, query, and hotplug. * * Copyright (c) 2005, Keir Fraser */ @@ -18,18 +18,17 @@ */ /* - * Create a new VCPU. This must be called before a VCPU can be referred to - * in any other hypercall (e.g., to bind event channels). The new VCPU - * will not run until it is brought up by VCPUOP_up. + * Initialise a VCPU. Each VCPU can be initialised only once. A + * newly-initialised VCPU will not run until it is brought up by VCPUOP_up. * * @extra_arg == pointer to vcpu_guest_context structure containing initial - * state for the new VCPU. + * state for the VCPU. */ -#define VCPUOP_create 0 +#define VCPUOP_initialise 0 /* - * Bring up a newly-created or previously brought-down VCPU. This makes the - * VCPU runnable. + * Bring up a VCPU. This makes the VCPU runnable. This operation will fail + * if the VCPU has not been initialised (VCPUOP_initialise). */ #define VCPUOP_up 1 @@ -41,7 +40,7 @@ * idea to ensure that the VCPU has entered a non-critical loop before * bringing it down. Alternatively, this operation is guaranteed * synchronous if invoked by the VCPU itself. - * 2. After a VCPU is created, there is currently no way to drop all its + * 2. After a VCPU is initialised, there is currently no way to drop all its * references to domain memory. Even a VCPU that is down still holds * memory references via its pagetable base pointer and GDT. It is good * practise to move a VCPU onto an 'idle' or default page table, LDT and -- 2.30.2